//setup ui
function initUI() {
    mainWnd.setNavagationTitle(qsTr("Navagation"));
    var id = mainWnd.addNavagationGroup("Layers");
    mainWnd.addNavagationCheck("Terrain", id);
    mainWnd.addNavagationCheck("Sky", id);
    mainWnd.addNavagationCheck("Building", id);
    mainWnd.addNavagationCheck("Street", id);
    mainWnd.addNavagationCheck("River", id);
    mainWnd.addNavagationCheck("Test", id);
    id = mainWnd.addNavagationGroup("Quick Entry");
    mainWnd.addNavagationFunction("Load Model", id);
    mainWnd.addNavagationFunction("Unload All", id);

}
//connect actions
function initActions() {
    var about = mainWnd.findChild("action_A");
    about["triggered()"].connect(
    function () {
        mainWnd.showMessage("Info", "OSGIS DEMO");
    }
    );
    mainWnd["checkChanged(QString, bool)"].connect(
    function (name, checked) {
        print(name + " checked");
        if (name == "Terrain") {
            if (checked)
                mainWnd.loadModel("data/yuelan.osga.90,0,0.rot");
        }
        if (name == "Sky") {
            if (checked) 
                mainWnd.loadSky();
        }
        if (name == "Building") {
            if (checked)
                mainWnd.loadModel("data/house1.ive.90,0,0.rot");
        }
        if (name == "Test") {
            if (checked)
                mainWnd.test();
        }

    }
    )
    mainWnd.enableNavagation(true);
}

initUI();
initActions();